import request from '@/utils/request'

/**
 * 获取部门列表数据
 */
export function reqGetDeparts() {
  return request({
    method: 'get',
    url: '/company/department'
  })
}
/**
 * 根据id删除部门
 */
export function reqDelDeparts(id) {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}
/**
 * 新增部门
 */
export function reqAddDeparts(data) {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}
/**
 * 获取部门详情
 */
export function reqGetDepartsDetails(id) {
  return request({
    method: 'get',
    url: `/company/department/${id}`
  })
}
/**
 * 根据id修改部门详情
 */
export function reqUpdateDepartsDetails(form) {
  return request({
    method: 'put',
    url: `/company/department/${form.id}`,
    data: form
  })
}
